$().ready(function(){
	
	$baseUrl = $("#baseUrl").text();
	
	/* bookDetail Page*/
	$bookPriceBlockLink = $("#bookPriceBlock a");
	$isbn = $("#isbnHidden");
	$amazonLink = $bookPriceBlockLink.attr('href');
	
	if ($isbn.length>0){
		
		if ($amazonLink==undefined){
			$amazonLink = '';
		}
		
		$("#bookPriceBlock").empty().html("<span class='waiting'>Fetching Price Info ...</span>");
		$.ajax({
		  	url: $baseUrl + "/book/renderajax",
		  	type: 'post',
		  	dataType: 'json',
		  	async: true,
		  	data: ({'type' : 'fetchPrice', 'isbn' : $isbn.text(),'amazonLink' : $amazonLink}),
		  	success: function(data) {
				$("#bookPriceBlock").empty().html(data.content).slideDown();
	 	}});  
	}
	
	
	

});